package com.stu.entity.service;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.stu.entity.base.BaseEntity;
import com.stu.entity.permission.User;

@Entity
@Table(name = "TECHNOLOGYBLOG")
public class TechnologyBlog extends BaseEntity {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String title;
	private String subtitle;
	private String content;
	
	private User user;
	
	@Column(name = "title", length = 500)
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Column(name = "subtitle", length = 200)
	public String getSubtitle() {
		return subtitle;
	}
	public void setSubtitle(String subtitle) {
		this.subtitle = subtitle;
	}
	@Column(name = "content", length = 1000)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public TechnologyBlog() {
		super();
	}
	public TechnologyBlog(String uuid) {
		super(uuid);
	}
	@Override
	public String toString() {
		return "TechnologyBlog [title=" + title + ", subtitle=" + subtitle + ", content=" + content + ", user=" + user
				+ "]";
	}
	
}
